package me.softwareengineer.guice.rendering.domain;

import java.util.List;

import me.softwareengineer.guice.rendering.listener.EndTableEvent;
import me.softwareengineer.guice.rendering.listener.Listener;
import me.softwareengineer.guice.rendering.listener.StartTableEvent;

/**
 * Represents Table element in DOM tree
 * 
 * @author yad.tahir
 * 
 *         <pre>
 * This class is thread-safe and can be cached/re-used and used concurrently.
 * </pre>
 */
public class TableElement extends Element {

	/**
	 * Creates a table element
	 * 
	 * @param children
	 *            the children of the table element. For more info, check
	 *            {@link HasChildren}
	 */
	public TableElement(List<Element> children) {
		super(children);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void afterElement(Listener listener) {
		EndTableEvent e = new EndTableEvent();
		listener.onEvent(e);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void beforeElement(Listener listener) {
		StartTableEvent e = new StartTableEvent();
		listener.onEvent(e);
	}
}
